/**
* 功能描述：时间范围选择器样式表
* @author jin xiaohang
* @date 2022/9/28 16:21
* @version 1.0
*/

@import "src/style/mixins/index";


//定义全局布局
@mixin time-range-picker-layout{

  //待选面板布局
  .#{$namespace}-time-range-picker-panel{
    position: relative;
    outline: none;
    height: calc(100% - 38px);

    //面板布局
    .#{$namespace}-time-range-picker-panel-part{
      position: relative;
      width: 50%;

      //面板头部
      .#{$namespace}-time-range-picker-panel-header{
        height: 40px;
        line-height: 40px;
        text-align: center;
        border-bottom: 0;
        user-select: none;

        //头部文字布局
        .#{$namespace}-time-range-picker-panel-header-title-year{
          display: inline-block;
          padding: 0 2px;
          color: #000000d9;
          font-weight: 500;
          line-height: 40px;
        }
      }

      //输入框容器样式
      .#{$namespace}-time-range-picker-input-wrap{
        border-bottom: 1px solid #f0f0f0;
        position: relative;
        height: 34px;
        padding: 6px 10px;

        //输入框布局
        .#{$namespace}-time-range-input{
          position: relative;
          display: inline-block;
          width: 100%;
          height: 24px;
          padding: 4px 0;
          line-height: 24px;
          color: #000000d9;
          font-size: 14px;
          background: #fff;
          transition: all .3s;
          border: 0;
          box-shadow: none;
        }
      }
    }

    //左侧面板布局
    .#{$namespace}-time-range-picker-panel-part-left{
      float: left;
    }

    //右侧面板布局
    .#{$namespace}-time-range-picker-panel-part-right{
      float: right;
    }
  }

  //脚部布局
  .#{$namespace}-time-range-picker-footer{
    position: relative;
    height: 38px;
    padding: 0 12px;
    line-height: 38px;
    border-top: 1px solid #f0f0f0;

    //脚步按钮
    .#{$namespace}-time-range-picker-footer-button{
      text-align: right;
      .#{$namespace}-time-range-picker-footer-ok-button{
        position: relative;
        display: inline-block;
        font-weight: 400;
        white-space: nowrap;
        text-align: center;
        border: 1px solid #1890ff;
        cursor: pointer;
        transition: all .3s cubic-bezier(.645,.045,.355,1);
        user-select: none;
        touch-action: manipulation;
        color: #fff;
        background: #1890ff;
        text-shadow: 0 -1px 0 rgb(0 0 0 / 12%);
        box-shadow: 0 2px #0000000b;
        height: 24px;
        padding: 0 7px;
        font-size: 14px;
        border-radius: 2px;
        line-height: 22px;
      }
    }

  }
}

//定义样式
@include b(time-range-picker){
  height: 100%;
  width: 100%;
  max-height: 340px;
  max-width: 550px;
  line-height: 1.5715;
  text-align: left;
  list-style: none;
  background-color: #fff;
  background-clip: padding-box;
  border: 1px solid #fff;
  border-radius: 2px;
  outline: none;
  box-shadow: 0 2px 8px #00000026;
  
  //选择器样式
  .#{$namespace}-time-range-picker-panel-body{

    display: inline-block;
    height: 100%;
    width: 100%;
    background-color: #fff;
    border-top: 1px solid #f0f0f0;

    //面板选择项
    .#{$namespace}-time-range-picker-panel-select{
      overflow: hidden;
      font-size: 14px;
      border-left: 1px solid #f0f0f0;
      position: relative;
      float: left;
      width: 90px;
      max-height: 220px;

      >ul{
        width: 56px;
        margin: 0;
        padding: 0 0 160px;
        list-style: none;
      }

      li{
        width: 100%;
        height: 32px;
        margin: 0;
        padding: 0 0 0 25px;
        line-height: 32px;
        text-align: left;
        list-style: none;
        cursor: pointer;
        transition: all .3s;
        user-select: none;
      }
    }

    //激活面板列样式
    .#{$namespace}-time-range-picker-panel-select-active{
      &:hover{
        cursor: pointer;
        overflow-y: auto;
        li{
          &:hover{
            background-color: #F5F5F5;
          }
        }
      }
    }

    //选中时间样式
    .#{$namespace}-time-range-picker-panel-select-date{
      color: #409EFF;
      background-color: #F5F5F5;
    }
  }

  //中间符号样式
  .#{$namespace}-time-range-picker-panel-middle{
    position: absolute;
    left: 50%;
    z-index: 1;
    height: 34px;
    margin: 1px 0 0;
    padding: 0 150px 0 0;
    line-height: 34px;
    color: #00000073;
    text-align: center;
    transform: translate(-50%);
    pointer-events: none;
  }

  //引用布局
  @include time-range-picker-layout;
}